Skip to content

Conversation

@srkethireddy
Copy link
Contributor

Fixing the utilization of the GCE Metadata host server address environment variable to account for the case where the user does not specify a port (defaults to port 8080)

b/451639946

cc: @apolcyn, @anicr7

@srkethireddy srkethireddy marked this pull request as draft November 4, 2025 00:29
@srkethireddy srkethireddy marked this pull request as ready for review November 4, 2025 00:45
@ejona86
Copy link
Member

ejona86 commented Nov 5, 2025

/gcbrun

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 5, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 5, 2025
String host = envValue;
int portIndex = host.lastIndexOf(':');
if (portIndex != -1) {
host = host.substring(0, portIndex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overriding the port is surprising. There should be some comment or such about what is going on.

(From what I can tell, the environment variable is normally accessing port 80. But for ALTS we use a different port, so we want to ignore the port because isn't the same port as used for authentication tokens.)

@ejona86
Copy link
Member

ejona86 commented Nov 10, 2025

@apolcyn, @anicr7, the logic here has become more subtle. We're supposed to release tomorrow, and this still seems a few days away from full testing. I'm wary of including it is the release.

@srkethireddy
Copy link
Contributor Author

Changed the utilization of the GCE Metadata host server address environment variable so that if a port is specified or unspecified, it defaults to use port 8080 for ALTS handshake.

Tested scenarios where environment variable was not set, environment variable was set but with no port, and environment variable was set with a port other than 8080

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 11, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 11, 2025
@ejona86
Copy link
Member

ejona86 commented Nov 11, 2025

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants